package com.sec.android.app.myfiles.module.local.file;

import android.content.Context;

import com.sec.android.app.myfiles.module.ContentObservable;
import com.sec.android.app.myfiles.module.abstraction.AbsContentObserverImp;
import com.sec.android.app.myfiles.module.abstraction.FileRecord;

/**
 * Created by daesu83.kim on 2015-07-21.
 */
public class LocalFileObserverImp extends AbsContentObserverImp {

    public LocalFileObserverImp(Context context, FileRecord record, ContentObservable updater) {
        super(context, record, updater);
    }

    @Override
    public void start() {
        LocalFileObserver.getInstance().addPath(mTargetRecord.getFullPath(), this);
    }

    @Override
    public void stop() {
        LocalFileObserver.getInstance().removePath(mTargetRecord.getFullPath(), this);
    }

    @Override
    public void onEvent(int event) {
        notifyContentChanged(event);
    }
}
